package com.qf.mybatisplus.service.impl;


import com.qf.mybatisplus.bean.entity.KingBaseUser;
import com.qf.mybatisplus.mapper.KingBaseMapper;
import com.qf.mybatisplus.service.KingBaseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class KingBaseServiceImpl implements KingBaseService {


        @Resource
        private KingBaseMapper kingBaseMapper;

    @Override
    public KingBaseUser selectUserByUserName(String userName) {
        //DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.SLAVE.name());
        //
        KingBaseUser kingBaseUser = kingBaseMapper.selectUserByUserName(userName);
      //  DynamicDataSourceContextHolder.clearDataSourceType();
        return kingBaseUser;
    }
}
